/* OSM layers for gvSIG. 
 * Geographic Information System of the Valencian Government
*
* Copyright (C) 2012 Nacho Brodin
* 
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
* MA  02110-1301, USA.
* 
*/
package org.gvsig.raster.osm.io;

import java.util.Hashtable;
import java.util.Map;

/**
 * @author Nacho Brodin (nachobrodin@gmail.com)
 */
public class OSMException extends Exception {
    private static final long serialVersionUID = 1476084093500156070L;
    private String            wmtsCode         = null;
    protected String          formatString     = null;
    protected String          messageKey       = null;
    protected long            code             = 0;

    public OSMException() {		
        init();			
    }	

    public OSMException(Throwable cause) {	
    	super(cause);
        init();	
        initCause(cause);
    }
    
    public OSMException(String msg, Throwable cause) {	
    	super(msg, cause);
        init();	
        this.formatString = msg;
    }

    public OSMException(String wfsCode,String message) {		
        init();	
        formatString = message;
        this.wmtsCode = wfsCode;
    }	

    public OSMException(String message) {        
        init(); 
        formatString = message;       
    }   

	@SuppressWarnings("unchecked")
	protected Map values() {		
        Hashtable params;
        params = new Hashtable();		
        return params;
    }

    public void init() {
        messageKey = "wmts_exception";
        formatString = "WMTS Exception";
        code = serialVersionUID;
    }

    /**
     * @return Returns the wfsCode.
     */
    public String getWfsCode() {
        return wmtsCode;
    }	
}